using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

using Model;
using BLL.WWW_WWW.Wiki;
using Model.WWW_WWW.Wiki;

namespace BLF.WWW_WWW.Wiki
{
	/// <summary>
	/// Manages all the User Accounts data.
	/// </summary>
	public class Users {

		private static int onlineUsers = 0;

		/// <summary>
		/// Gets or sets the Online Users.
		/// </summary>
		public static int OnlineUsers {
			get { return onlineUsers; }
			set { onlineUsers = value; }
		}

		private static Users instance = null;

		/// <summary>
		/// Gets or sets the singleton instance of the <b>Users</b> object.
		/// </summary>
		public static Users Instance {
			get { return instance; }
			set { instance = value; }
		}

		//private List<UserInfo> users = null;

		/// <summary>
		/// 
		/// </summary>
		public Users() 
        {
		}

		public UserInfo Find(string username) {
			return Wiki.FindUser(username);
		}
		
		public string UserLink(string username) {
			UserInfo u = Find(username);
			if(u != null) {
				return @"<a href=""Message.htm?Username=" + Tools.UrlEncode(u.Username) + @""">" + u.NickName + "</a>";
			}
			else return username;
		}
        
	}

}
